//
// Created by codex on 2024/7/23.
//
#include "Drv_Uav.h"
#include  "usart.h"

void Uav_DataSend(uint8_t *data)
{
    uint8_t data_t[25];
    data_t[0]=0xAA;
    data_t[1]=CAR_TYPE;
    data_t[2]=CMD_TYPE;
    data_t[3]=1;
    data_t[4]=data[1];
    uint8_t check_sum1 = 0, check_sum2 = 0;
    uint8_t len=7;

    for (uint8_t i = 0; i < len - 2; i++)
    {
        check_sum1 += *(data_t + i);
        check_sum2 += check_sum1;
    }
    data_t[len-2]=check_sum1;
    data_t[len-1]=check_sum2;
    print_UARTx(&huart4,data_t);
}
